#ifndef FRAMEWND_H
#define FRAMEWND_H

#include "main.h"
#include "Window.h"
#include "Project.h"
#include "PlantInterface.h"
#include "ToolWnd.h"
#include "resource.h"

#include <commctrl.h>

#define IDW_CLIENT		2000
#define IDW_FIRSTCHILD	2001
#define	IDC_STATUS_BAR  2002

class FrameWnd:public Window
{
public:
	FrameWnd(void);
	FrameWnd(const LPCHAR caption);

	~FrameWnd(void);

	void setStatus(LPCHAR status);
	void mainLoop();	

	static ToolWnd *toolWnd;

protected:
	HWND	hClientWnd;	
	HWND	hStatusBar;	
	HMENU	hMenu;

	static LPCHAR	szClassName;
	static bool		registredClass;

	LRESULT CALLBACK objectProc(HWND hWnd, 
								UINT uMsg, 
								WPARAM wParam, 
								LPARAM lParam );

	static LRESULT CALLBACK classProc(	HWND hFrameWnd, 
										UINT uMsg, 
										WPARAM wParam, 
										LPARAM lParam );

private:
	Project			*project;
	PlantInterface	*plantInterface;

	void createStatusBar();
	void registerClass();
	void onCreate(HWND hWnd);

	void activeMIDIChild(HWND hChild);

};

typedef FrameWnd* LPFrameWnd;

#endif
